<?php
namespace Common\Model;
use Think\Model;
/**
* 基类model
*/
Class BaseModel extends Model{

    protected function treeData($rawData,$pid,$level){
        static $tmp = [];
        foreach ($rawData as $k => $v){
            if ($v['pid'] == $pid){
                $v['_name'] = str_repeat('&nbsp;&nbsp;',$level) . $v['cname'];
                $tmp[] = $v;
                $this->treeData($rawData,$v['cid'],$level+1);
            }
        }
        return $tmp;
    }
}
